package com.flesler.componentas.components.position
{
	import com.flesler.componentas.core.base.BaseComponent;
	
	public class PositionComponent extends BaseComponent
	{
		private var _x:Number = 0;
		private var _y:Number = 0;
		
		public function PositionComponent()
		{
		}
		
		private function changed():void
		{
			entity.dispatchEvent(new PositionComponentEvent(PositionComponentEvent.CHANGED));
		}

		
		public function get x():Number
		{
			return _x;
		}

		public function set x(v:Number):void
		{
			if (x === v) return;
			_x = v;
			changed();
		}

		
		public function get y():Number
		{
			return _y;
		}

		public function set y(v:Number):void
		{
			if (y === v) return;
			_y = v;
			changed();
		}
	}
}